{extend name="public/base" /}

{block name="title"}<title>后台首页</title>{/block}

{block name="pjax_container"}
<style>
tr>th,td{
    text-align: center;
}
 
.content-header>.breadcrumb>li{
    color: #999;
}
.content-header>.breadcrumb>.active{
    color: #666;
}
.content-header{
    height: 51px;
 
}
.btn-primary{
      background-color: #1890FF;
    color: #fff;
    border: none;
    border-radius: 6px !important;
    margin-left: 15px;
    padding: 5px 10px; 
}
.box-primary{
  border-top-color: #ecf0f5 !important;
  border-top-width: 16px;
  
}
.btn-primary:hover{
     background-color: #1890FF;
    color: #fff;
    border: none;
    opacity: .9;
    border-radius: 6px !important; 
}
.delete-one{
    background-color: ff4141 !important;
    margin-left: 15px;
    border-radius: 6px;
}
.sreachs{
       background-color: #1890FF;
    color: #fff;
    border: none;
    border-radius: 6px !important;
    margin-left: 15px;
    padding: 7px 15px; 
}
</style>
<section class="content-header">
    <ol class="breadcrumb">
        <li class="active">后台首页</li>
    </ol>
</section>
<section class="content">
    <div class="row">
        <div class="col-lg-5 col-sm-5 col-xs-12">
            <div class="box box-primary">
                <div class="box-header">
                    <h3 class="box-title">{$Think.lang.system_config}</h3>
                </div>
                <div class="box-body no-padding">
                    <table class="table table-hover">
                        {volist name="systemConfig" id="vo" }
                        <tr>
                            <td>{$key}：{$vo}</td>
                        </tr>
                        {/volist}
                    </table>
                </div>
            </div>
        </div>
    </div>


    <div class="col-md-12">
        <div class="box box-primary">
            <div class="box-header with-border">
                <div class="pull-left">
                    {:authAction('company/index_del','delete_all')}
                    <a class="btn btn-sm btn-primary delete-all" href="javascript:void(0);" data-url="/admin/index/send_msg" data-title="发送通知"> 发送通知</a>
                </div>

            </div>
            <div class="box-body table-responsive">
                <table class="table table-bordered table-hover">
                    <tr>
                        <th width="35"><input type="checkbox" class="minimal checkbox-toggle"></th>
                        <th>企业名称</th>
                        <th>企业账号</th>
                        <th>所在地区</th>
                        <th>所属行业</th>
                        <th>经营类型</th>
                        <th>公司电话</th>
                        <th>负责人</th>
                        <th>负责人电话</th>
                        <th>对接人</th>
                        <th>对接人电话</th>
                        <th>启动日期</th>
                        <th>状态</th>
                        <th>剩余时间</th>
                    </tr>
                    {volist name="$list" id="v"}
                    <tr>
                        <td><input type="checkbox" name="id[]" value="{$v.id}" class="minimal checkbox"></td>
                        <td>{$v["name"]}</td>
                        <td>{$v["account"]}</td>
                        <td>
                            {$region_list[$v['province_id']]|default=''}-
                            {$region_list[$v['city_id']]|default=''}-
                            {$region_list[$v['area_id']]|default=''}
                        </td>
                        <td>{$trade_list[$v['trade_id']]['name']??''}</td>
                        <td>{$manage_list[$v['manage_id']]['name']??''}</td>
                        <td>{$v["com_mobile"]}</td>
                        <td>{$v["principal"]}</td>
                        <td>{$v["mobile"]}</td>
                        <td>{$v["docking_people"]}</td>
                        <td>{$v["docking_mobile"]}</td>
                        <td>{:date('Y-m-d', $v['start_time'])}</td>
                        <td style="vertical-align:middle">
                            <a href="javascript:void(0);" data-id="{$v['id']}" data-field="status"
                               data-value="{$v['status']}" data-url="{:url('company/index_edit', ['id'=>$v['id']])}"
                               class='editimg fa {if condition="$v.status == 0 "}fa-times-circle text-red{else /}fa-check-circle text-green{/if}'></a>
                        </td>
                        <td>
<?php
                            $r = $v['use_time'] - time();
                            echo time_to_str($r);
?>
                        </td>
                    </tr>
                    {/volist}
                </table>
            </div>
            <div class="box-footer clearfix">
                {$list->render()}
            </div>
        </div>
    </div>
</section>
<script>
    $(function() {
        // 列表部分 全选
        $('input[type="checkbox"].minimal, input[type="radio"].minimal').iCheck({
            checkboxClass: 'icheckbox_minimal-blue',
            radioClass: 'iradio_minimal-blue'
        });
        $('.checkbox-toggle').on('ifChecked', function (event) {
            var _this = $(this);
            var _table = _this.closest('.table');
            _table.find("tr td input[type='checkbox']").iCheck("check");
        });
        $('.checkbox-toggle').on('ifUnchecked', function (event) {
            var _this = $(this);
            var _table = _this.closest('.table');
            _table.find("tr td input[type='checkbox']").iCheck("uncheck");
        });
    });
</script>
{/block}